<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>autocompleter</title>
	<style type="text/css">
		body { font-family: sans-serif; font-size: 14px; line-height: 1.6em; margin: 0; padding: 0; }
		.container { width: 800px; margin: 100px auto; }

		.autocomplete-suggestions { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; border: 1px solid #999; background: #FFF; cursor: default; overflow: auto; -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64); }
		.autocomplete-suggestion { padding: 2px 5px; white-space: nowrap; overflow: hidden; }
		.autocomplete-no-suggestion { padding: 2px 5px;}
		.autocomplete-selected { background: #F0F0F0; }
		.autocomplete-suggestions strong { font-weight: bold; color: #000; }
		.autocomplete-group { padding: 2px 5px; font-weight: bold; font-size: 16px; color: #000; display: block; border-bottom: 1px solid #000; }

		input { font-size: 28px; padding: 10px; border: 1px solid #CCC; display: block; margin: 20px 0; }

	</style>
</head>
<body>
	<div class="container">
        <input type="text" name="nope" id="nope" autocomplete="off" placeholder="" maxlength="40" />
    </div>
    <script type="text/javascript" src="scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="./jquery.autocomplete.js"></script>
	<script type="text/javascript">
		$('#nope').autocomplete({
			serviceUrl:'./demo.php',
			minChars:1, //触发自动提示所需的最少字符数
			deferRequestBy:100, //延迟100ms请求
			onSelect: function(suggestion) {
				// 执行跳转等操作
				console.log(suggestion.value);
	        }
	    });
	</script>
</body>
</html>